﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;
namespace DAO
{
    public class HOCKYDAO
    {
        QUANLY_DIEMDataContext db = new QUANLY_DIEMDataContext();
        //lOAD DANH SACH HOC KY TRONG NAM
        public List<HOCKYDTO> LoadDachHocKy()
        {
            List<HOCKYDTO> ds = new List<HOCKYDTO>();
            try
            {
                var dshocky = from p in db.HOCKies
                              select p;
                foreach(var r in dshocky)
                {
                    HOCKYDTO hk = new HOCKYDTO();
                    hk.MAHK = r.MAHK;
                    hk.TENHK = r.TENHK;
                    ds.Add(hk);
                }
                return ds;
            }
            catch
            {
                return null;
            }
        }
        
    }
}
